<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<title></title>
	</head>
	<style type="text/css">
		h5 {
			padding-top: 15px;
		}
		
		.field-contain label {
			width: auto;
			padding-right: 0;
		}
		
		.field-contain input[type='text'] {
			width: 40px;
			height: 30px;
			padding: 5px 0;
			float: none;
			text-align: center;
		}
		
		#range {
			font-size: 10px !important;
			margin-top: -10px;
		}
		
		input[type=range] {
			-webkit-appearance: none;
			width: 300px;
			border-radius: 10px;
			/*这个属性设置使填充进度条时的图形为圆角*/
		}
		
		input[type=range]::-webkit-slider-thumb {
			-webkit-appearance: none;
		}
		
		input[type=range]::-webkit-slider-runnable-track {
			height: 15px;
			border-radius: 10px;
			/*将轨道设为圆角的*/
			box-shadow: 0 1px 1px #def3f8, inset 0 .125em .125em #0d1112;
			/*轨道内置阴影效果*/
		}
		
		input[type=range]:focus {
			outline: none;
		}
		
		input[type=range]::-webkit-slider-thumb {
			-webkit-appearance: none;
			height: 25px;
			width: 25px;
			margin-top: -5px;
			/*使滑块超出轨道部分的偏移量相等*/
			background: #ffffff;
			border-radius: 50%;
			/*外观设置为圆形*/
			border: solid 0.125em rgba(205, 224, 230, 0.5);
			/*设置边框*/
			box-shadow: 0 .125em .125em #3b4547;
			/*添加底部阴影*/
		}
	</style>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-back  mui-icon-backmui-pull-left"></a>
			<h1 class="mui-title">更多服务</h1>
		</header>

		<div class="mui-content">
			<div class="mui-card">
				<ul class="mui-table-view">
					<li class="mui-table-view-cell" id="tuichu">
						<a class="mui-navigate-right" href="#">
							<span>退出登录</span>
						</a>
					</li>
					<li class="mui-table-view-cell">
						<span>调节明暗</span>
						<input type="range" name="" id="range" value="50" min="0" max="100" />
					</li>
					<li class="mui-table-view-cell" id="clear">
						系统缓存
						<span style="float: right;" id="cache">
						</span>
					</li>
				</ul>
			</div>
		</div>
		<span id="light"></span>
		</div>
	</body>
	<script src="../../js/mui.min.js"></script>

	<script src="../../js/myjs/localVarchar.js"></script>
	<script src="../../js/ipjs/ip.js"></script>
	<script type="text/javascript">
		mui.init({
			swipeBack: true //启用右滑关闭功能
		});
		//存储亮度信息
		var light;
		if(localStorage.getItem("light") == null) {
			document.getElementById("range").value = 50;
		} else {
			document.getElementById("range").value = localStorage.getItem("light");
		}
		document.getElementById("range").addEventListener('change', function() {
			light = this.value;
			localStorage.setItem("light", this.value);
			plus.screen.setBrightness(light / 100);
		});
		document.getElementById("clear").addEventListener('tap', function() {
			plus.cache.calculate(function(size) {
				sizeCache = size;
				mui.confirm("系统缓存为" + parseFloat(sizeCache / (1024 * 1024)).toFixed(2) + "M？", "清除缓存", ["确认", "取消"], function(e) {
					if(e.index == 1) {} else {
						plus.cache.clear(function() {
							mui.toast("清除完毕！")
						});
					}
				});
			});
		});
		// H5 plus事件处理	获取imei码
		function plusReady() {
			//获取缓存信息
			plus.cache.calculate(function(size) {
				sizeCache = size;
				document.getElementById("cache").innerHTML = parseFloat(sizeCache / (1024 * 1024)).toFixed(2) + "M";
			});
			/*			alert("IMEI: " + plus.device.imei+
						"手机型号: " + plus.device.model+
						"系统UI: " + plus.device.vendor+
						"uuid: "+plus.device.uuid);*/
		}
		if(window.plus) {
			plusReady();
		} else {
			document.addEventListener("plusready", plusReady, false);
		}
		document.getElementById("tuichu").addEventListener('tap', function() {
			localStorage.removeItem(LOCAL_USER_INFO);
			location.href = "../../login.html";
		})
	</script>

</html>